home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / overm82.zip / BTBATS.ZIP / MAIL.BAT < prev    next >
DOS Batch File  |  1990-02-19  |  4KB  |  174 lines

  1. echo off
  2.  
  3. rem
  4. rem *------------------------------------------------------------*
  5. rem *  Mail handler batch file - Runs mail utilities and the     *
  6. rem *  nodelist compiler.                                        *
  7. rem *------------------------------------------------------------*
  8. rem
  9.  
  10. d:
  11. cd\binkley
  12.  
  13. :Process
  14. :Premail
  15.  
  16.    echo  CD
  17.    echo  ╒═[ Export Mail ]═══════════════════════════════════════════════════════════╕
  18.    echo  │ Exporting new messages from RBBS-PC to *.MSGs                             │
  19.    echo  ╘═══════════════════════════════════════════════════════════════════════════╛
  20.    echo  CD
  21.  
  22.    rem
  23.    rem Scan all of the RBBS message bases to export newly-entered
  24.    rem messages into *.MSGs
  25.    rem
  26.    rem Use R2FC.  If we're rescanning the message base, add /RESCAN
  27.    rem to the command line.
  28.    rem
  29.    rem R2FC exits with the following errorlevels:
  30.    rem
  31.    rem    0 = Nothing Exported
  32.    rem    1 = System Misconfigured or Disk Error
  33.    rem    2 = New Messages Exported, and need to be Scanned
  34.  
  35.    r2fc overmail.cfg %3
  36.  
  37.    if errorlevel 2 goto DoQMScan
  38.    if errorlevel 1 goto BadCFG
  39.    goto SkipQMScan
  40.  
  41.    :DoQMScan
  42.  
  43.       rem
  44.       rem Run Qmail to export new messages to other systems.
  45.       rem
  46.       rem Use -q to force it to run quietly.
  47.  
  48.       qm scan pack -q
  49.  
  50.    :SkipQMScan
  51.  
  52. :Posmail
  53.  
  54.    echo  CD
  55.    echo  ╒═[ Import Mail ]═══════════════════════════════════════════════════════════╕
  56.    echo  │ Importing new *.MSGs into RBBS-PC                                         │
  57.    echo  ╘═══════════════════════════════════════════════════════════════════════════╛
  58.    echo  CD
  59.  
  60.    rem
  61.    rem Let QMail unpack received packets into *.MSG files and
  62.    rem to pack messages that need to be forwarded to other nodes.
  63.    rem
  64.    rem Use -q to force it to run quietly.
  65.  
  66.    qm toss scan -q
  67.  
  68.    if errorlevel 3 goto DiskFull
  69.  
  70.    qm pack -q
  71.  
  72.    if errorlevel 3 goto DiskFull
  73.  
  74.    rem
  75.    rem Import new *.MSGs into the RBBS message base.
  76.    rem
  77.    rem Use F2RC.  F2RC exits with the following errorlevels:
  78.    rem
  79.    rem    1 = System Misconfigured or Disk Error
  80.    rem    0 = Processing OK
  81.  
  82.    f2rc overmail.cfg
  83.  
  84.    if errorlevel 1 goto BadCFG
  85.  
  86.    if %1$ == $ goto SkipRenum
  87.  
  88.    if %1 == renum goto Renum
  89.    if %1 == RENUM goto Renum
  90.    if %1 == Renum goto Renum
  91.  
  92.    goto SkipRenum
  93.  
  94. :Renum
  95.  
  96.    echo  CD
  97.    echo  ╒═[ Pack/Renum ]════════════════════════════════════════════════════════════╕
  98.    echo  │ Packing and renumbering all of the messages on the system                 │
  99.    echo  ╘═══════════════════════════════════════════════════════════════════════════╛
  100.    echo  CD
  101.  
  102.    rem
  103.    rem Pack the main RBBS messages file.
  104.    rem
  105.  
  106.    pip overmail.cfg
  107.  
  108.    rem
  109.    rem Run the renumbering program.
  110.    rem
  111.  
  112.    renum311 overmail.cfg
  113.  
  114.    goto End
  115.  
  116. :SkipRenum
  117.  
  118.    goto End
  119.  
  120. :Usage
  121.  
  122.    echo Usage: MAIL [shell] [renum] [/rescan]
  123.    echo .
  124.    echo Add the keyword SHELL to cause the batch file not not reinvoke
  125.    echo BinkleyTerm, but just to terminate.
  126.    echo .
  127.    echo Add the keyword RENUM to cause the messages to be packed
  128.    echo and renumbered.
  129.    echo .
  130.    echo Add the keyword /rescan to cause the messages to be rescanned.
  131.  
  132.    goto Terminate
  133.  
  134. :BadCFG
  135.  
  136.    echo System Misconfigured or disk full.  Fix that, will you?
  137.    pause
  138.  
  139.    goto Terminate
  140.  
  141. :DiskFull
  142.  
  143.    echo QMail reports that your disk is full.  Do something about it.
  144.    pause
  145.  
  146.    goto Terminate
  147.  
  148. :End
  149.  
  150. rem
  151. rem Restart the bulletin board by invoking the BinkleyTerm batch file
  152. rem
  153.  
  154. if %2$ == $ goto ChkShell1
  155.  
  156. if %2 == shell goto Terminate
  157. if %2 == SHELL goto Terminate
  158. if %2 == Shell goto Terminate
  159.  
  160. :ChkShell1
  161.  
  162.    if %1$ == $ goto SkipShell1
  163.  
  164.    if %1 == shell goto Terminate
  165.    if %1 == SHELL goto Terminate
  166.    if %1 == Shell goto Terminate
  167.  
  168. :SkipShell1
  169.  
  170.    binkley.bat
  171.  
  172. :Terminate
  173.  
  174.